package com.gxa.customer.service.Impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxa.common.commons.R;
import com.gxa.common.pojo.IndustryType;
import com.gxa.customer.mapper.IndustryMapper;
import com.gxa.customer.service.IndustryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class IndustryServiceImpl extends ServiceImpl<IndustryMapper, IndustryType> implements IndustryService {
    @Autowired
    private IndustryMapper industryMapper;

    //查询所有行业类型
    @Override
    public R selectAllIndustry() {
        R r = new R();
        List<IndustryType> industryTypes = industryMapper.selectList(null);
        if(industryTypes == null){
            r.setCode(500);
            r.setMsg("找不到参数！！！");
            return r;
        }else {
            r.setCode(200);
            r.setMsg("查询成功！");
            r.setData(industryTypes);
            return r;
        }
    }
}
